'use strict';
/**
 * Created by QianQi on 2017/5/18.
 */
$(function(){
    var oHideParams = $.getHideParams(),// <body> 下隐藏域键值对，name 为键
        oUrlParams = $.getUrlParams();// url 附加参数键值对
    var URLS={};
    // demo 测试代码，2 秒后隐藏进度条
    var fHideLoading = function(){
        setTimeout(function(){
            $.hideLoading();
        },2000);
    };
    // 支持进度条内容重绘
    var fInRender = function(obj){
        return '<div class="loadingdata-in"><span style="color:#d9544f;">***</span>' + obj.content + '</div>';
    };
    // 树节点点击事件
    var fOnBtnsClick=function(){
        var jqThis = $(this);
        switch(jqThis.attr('data-type')){
            case 'loading0':
                $.showLoading();
                break;
            case 'loading1':
                $.showLoading({
                    content:'2秒后消失，请稍候'
                });
                break;
            case 'loading2':
                $.showLoading({
                    content:'2秒后消失，请稍候',
                    fInRender: fInRender
                });
                break;
        }
        fHideLoading();// 2 秒后隐藏进度条
    };
    /** =================== **/
    $('.js-btns').on('click','.btn',fOnBtnsClick);
});